import request from '@/utils/request'

const api_name = '/admin/kywPostController'
// 分页列表
export const selectPost = (page,limit,post) => {
    return request({
        url: `${api_name}/selectPost/${page}/${limit}`,
        method: 'get',
    })
}

// 保存信息
export const addPost = sysMenu => {
    return request({
        url: `${api_name}/addPost`,
        method: 'post',
        data: sysMenu,
    })
}

// 修改信息
export const updatePost = sysMenu => {
    return request({
        url: `${api_name}/updatePost`,
        method: 'post',
        data: sysMenu,
    })
}

// 根据id删除数据
export const deletePost = id => {
    return request({
        url: `${api_name}/deletePost/${id}`,
        method: 'delete',
    })
}
// 根据部门id查询岗位
export const selectByParentId = (id) => {
    return request({
        url: `${api_name}/selectByParentId/${id}`,
        method: 'get',
    })
}

// 查询岗位关联用户
export const selectPostCount = (id) => {
    return request({
        url: `${api_name}/selectPostCount/${id}`,
        method: 'get',
    })
}